//
//  MMViewController.m
//  MMPodLibraryTest
//
//  Created by MMPodLibrary on 07/14/2017.
//  Copyright (c) 2017 MMPodLibrary. All rights reserved.
//

#import "MMViewController.h"

@interface MMViewController ()

@end

@implementation MMViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    __block UIWindow *appdelegateWindow ;
    
    NSArray *windowsArr = [[UIApplication sharedApplication] windows];
    UIScreen *mainScreen = [UIScreen mainScreen];
    
    [windowsArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        UIWindow *window = (UIWindow*)obj;
        if (mainScreen == window.screen) {
            appdelegateWindow = window;
            *stop = YES;
        }
    }];
    
    
    if (!appdelegateWindow) {
        appdelegateWindow = [[UIApplication sharedApplication] keyWindow];
    }
    
    NSLog(@"-----%@-----",appdelegateWindow);
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
